package com.zhuannimei.view;

import com.zhuannimei.R;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

public class XXDialog extends Dialog {
	private LayoutInflater lf;
	private View view;
	private XXButton btOk, btNo;
	private TextView tvDesc;

	public XXDialog(Context context, boolean cancelable,
			OnCancelListener cancelListener) {
		super(context, cancelable, cancelListener);
	}

	public XXDialog(Context context) {
		super(context, R.style.MyDialog);
		lf = LayoutInflater.from(context);
		view = lf.inflate(R.layout.dialog_view, null);
		tvDesc = (TextView) view.findViewById(R.id.tv_desc);
		btOk = (XXButton) view.findViewById(R.id.bt_ok);
		btNo = (XXButton) view.findViewById(R.id.bt_no);
		btOk.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {

			}
		});
		setContentView(view);
	}

	@Override
	public void setContentView(View view) {
		super.setContentView(view);
	}

	public void setMessage(String msg) {
		tvDesc.setText(msg);
	}

	public void setBtOkOnClickListener(View.OnClickListener listener) {
		btOk.setOnTouchListener(null);
		btOk.setOnClickListener(listener);
	}

	public void setBtNoOnClickListener(View.OnClickListener listener) {
		btNo.setOnTouchListener(null);
		btNo.setOnClickListener(listener);
	}
}
